package edu.hitsz.Rank;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

public class RankObjcet implements Serializable {
    private int rank;
    private String userName;
    private int score;
    private String time;

    public int getRank() {
        return rank;
    }

    public RankObjcet(String userName, int score) {
        this.userName = userName;
        this.score = score;
        this.time = setTime();
    }

    public void setRank(int rank) {
        this.rank = rank;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public String getTime() {
        return time;
    }

    private String setTime() {
        Date d = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
        String dateFormat = sdf.format(d);
        return dateFormat;
    }
}
